home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 8_3.lha / 8_3 / tstfloat.c < prev    next >
Text File  |  1993-08-08  |  493b  |  30 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. include <stream.h>
  6. include <string.h>
  7.  
  8. include "8_3_float.c"
  9.  
  10. / copy a stream of doubles
  11. include <error.h>
  12. ain(int, char**)
  13.  
  14.    for (;;)
  15. {
  16. double a;
  17. if (!read_double(cout, cin, &a))
  18.     break;
  19. cout << a << "\n";
  20. if (!cout)
  21.     break;
  22. }
  23.  
  24.    if (!cin.eof())
  25. error("error reading input");
  26.    if (cout.bad())
  27. error("error writing output");
  28.    return 0;
  29.  
  30.